#!/bin/bash
set -xeuo pipefail
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
cd ${BASE_DIR}

# 虚拟机
vagrant status|grep running || {
 vagrant up
}

# 部署zfs服务端
vagrant ssh zfs -c "sudo /vagrant/zfs/provision.sh"

# zfs的客户端
vagrant ssh client -c 'ansible-playbook -i "localhost," -c local /vagrant/client.yml'

echo "done"



